<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="./vue.js"></script>
</head>
<body>
<div id="root">
    <button onclick="setNum(200)">{{num}}</button>
    <button @click="num++">{{num}}</button>
</div>
</body>
<script>
    const vm = new Vue({
        el: "#root",
        data:{
            num:1000
        },
        methods:{
            setNum(){
                this.num = 900;
                // console.log(this)
            },
        }
    });
    const setNum = function(num){
        vm.num = num;
    }
</script>
</html>